package com.lcy.eb.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lcy.eb.mapper.EbCommentMapper;
import com.lcy.eb.model.EbComment;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CommentService {
    @Resource
    private EbCommentMapper ebCommentMapper;
    public Page list(int psize){
        Page page=new Page(psize,5);
        Page commentPage=ebCommentMapper.selectPage(page,
                Wrappers.<EbComment>lambdaQuery().orderByDesc(EbComment::getEcCreateTime));
        return commentPage;
    }
}
